<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>LuaApp项目接口文档</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>LuaApp</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Methods">Methods</a></li>
</ul>


<h2>Classes</h2>
<ul class="nowrap">
  <li><a href="../classes/ActivityIndicatorView.html">ActivityIndicatorView</a></li>
  <li><a href="../classes/AlertView.html">AlertView</a></li>
  <li><a href="../classes/Application.html">Application</a></li>
  <li><a href="../classes/AudioEngine.html">AudioEngine</a></li>
  <li><a href="../classes/Button.html">Button</a></li>
  <li><a href="../classes/CaptureView.html">CaptureView</a></li>
  <li><a href="../classes/CheckBox.html">CheckBox</a></li>
  <li><a href="../classes/ClippingView.html">ClippingView</a></li>
  <li><a href="../classes/Control.html">Control</a></li>
  <li><a href="../classes/DatePickerView.html">DatePickerView</a></li>
  <li><a href="../classes/Device.html">Device</a></li>
  <li><a href="../classes/DownloadManager.html">DownloadManager</a></li>
  <li><a href="../classes/DrawView.html">DrawView</a></li>
  <li><a href="../classes/DrawerController.html">DrawerController</a></li>
  <li><a href="../classes/FileUtils.html">FileUtils</a></li>
  <li><a href="../classes/GifView.html">GifView</a></li>
  <li><a href="../classes/HttpClient.html">HttpClient</a></li>
  <li><a href="../classes/HttpRequest.html">HttpRequest</a></li>
  <li><a href="../classes/Image.html">Image</a></li>
  <li><a href="../classes/ImageView.html">ImageView</a></li>
  <li><a href="../classes/Label.html">Label</a></li>
  <li><a href="../classes/LinearView.html">LinearView</a></li>
  <li><a href="../classes/ListView.html">ListView</a></li>
  <li><a href="../classes/ListViewCell.html">ListViewCell</a></li>
  <li><a href="../classes/NavController.html">NavController</a></li>
  <li><a href="../classes/Progress.html">Progress</a></li>
  <li><a href="../classes/Slider.html">Slider</a></li>
  <li><a href="../classes/Stepper.html">Stepper</a></li>
  <li><a href="../classes/Switch.html">Switch</a></li>
  <li><a href="../classes/TabBarController.html">TabBarController</a></li>
  <li><strong>TextField</strong></li>
  <li><a href="../classes/TextView.html">TextView</a></li>
  <li><a href="../classes/UILoader.html">UILoader</a></li>
  <li><a href="../classes/View.html">View</a></li>
  <li><a href="../classes/ViewController.html">ViewController</a></li>
  <li><a href="../classes/WebView.html">WebView</a></li>
  <li><a href="../classes/Window.html">Window</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/Animation.html">Animation</a></li>
  <li><a href="../modules/class.html">class</a></li>
  <li><a href="../modules/constants.html">constants</a></li>
  <li><a href="../modules/crossapp.html">crossapp</a></li>
  <li><a href="../modules/cjson.html">cjson</a></li>
  <li><a href="../modules/mobdebug.html">mobdebug</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
  <li><a href="../topics/readme.md.html">readme</a></li>
  <li><a href="../topics/layout.md.html">layout</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>TextField</code></h1>
<p>文本框控件，继承自Control</p>
<p>

</p>
    <h3>See also:</h3>
    <ul>
         <a href="../classes/Control.html#">Control</a>
    </ul>


<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#TextField:new">TextField:new ()</a></td>
	<td class="summary">创建对象</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setClearButtonMode">TextField:setClearButtonMode (mode)</a></td>
	<td class="summary">设置清空按钮的模式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setDelegate">TextField:setDelegate (table)</a></td>
	<td class="summary">设置代理</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getClearButtonMode">TextField:getClearButtonMode ()</a></td>
	<td class="summary">获取清空按钮的模式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setMarginLeft">TextField:setMarginLeft (margin)</a></td>
	<td class="summary">设置文本左边边距</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getMarginLeft">TextField:getMarginLeft ()</a></td>
	<td class="summary">文本左边边距</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setMarginRight">TextField:setMarginRight (margin)</a></td>
	<td class="summary">设置文本右边边距</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getMarginRight">TextField:getMarginRight ()</a></td>
	<td class="summary">文本右边边距</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setMarginImageLeft">TextField:setMarginImageLeft (size, image)</a></td>
	<td class="summary">设置文本左边图标</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setMarginImageRight">TextField:setMarginImageRight (size, image)</a></td>
	<td class="summary">设置文本右边图标</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setFontSize">TextField:setFontSize (size)</a></td>
	<td class="summary">设置文本尺寸</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getFontSize">TextField:getFontSize ()</a></td>
	<td class="summary">获取文本尺寸</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setPlaceHolderText">TextField:setPlaceHolderText (text)</a></td>
	<td class="summary">设置无内容时，占位文字</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getPlaceHolderText">TextField:getPlaceHolderText ()</a></td>
	<td class="summary">获取无内容时，占位文字</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setPlaceHolderColor">TextField:setPlaceHolderColor (color)</a></td>
	<td class="summary">设置占位文字的颜色</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getPlaceHolderColor">TextField:getPlaceHolderColor ()</a></td>
	<td class="summary">获取占位文字的颜色</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setText">TextField:setText (text)</a></td>
	<td class="summary">设置文本</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getText">TextField:getText ()</a></td>
	<td class="summary">获取文本</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setTextColor">TextField:setTextColor (color)</a></td>
	<td class="summary">设置文本颜色</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getTextColor">TextField:getTextColor ()</a></td>
	<td class="summary">获取文本颜色</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setKeyboardType">TextField:setKeyboardType (KeyboardType)</a></td>
	<td class="summary">设置键盘类型</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getKeyboardType">TextField:getKeyboardType ()</a></td>
	<td class="summary">获取键盘类型</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setReturnType">TextField:setReturnType (ReturnType)</a></td>
	<td class="summary">设置返回类型</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getReturnType">TextField:getReturnType ()</a></td>
	<td class="summary">获取返回类型</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setTextFieldAlign">TextField:setTextFieldAlign (TextFieldAlign)</a></td>
	<td class="summary">设置文本对齐方式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getTextFieldAlign">TextField:getTextFieldAlign ()</a></td>
	<td class="summary">获取文本对齐方式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setSecureTextEntry">TextField:setSecureTextEntry (secureMode)</a></td>
	<td class="summary">设置密码输入模式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:isSecureTextEntry">TextField:isSecureTextEntry ()</a></td>
	<td class="summary">是否是密码输入模式</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setAllowkeyBoardHide">TextField:setAllowkeyBoardHide (allow)</a></td>
	<td class="summary">设置是否允许键盘隐藏</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:isAllowkeyBoardHide">TextField:isAllowkeyBoardHide ()</a></td>
	<td class="summary">是否允许键盘隐藏</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setMaxLenght">TextField:setMaxLenght (maxLen)</a></td>
	<td class="summary">设置文本最大长度</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:getMaxLenght">TextField:getMaxLenght ()</a></td>
	<td class="summary">获取文本最大长度</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#TextField:setBackgroundImage">TextField:setBackgroundImage (image)</a></td>
	<td class="summary">设置背景图</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Methods"></a>Methods</h2>

    <dl class="function">
    <dt>
    <a name = "TextField:new"></a>
    <strong>TextField:new ()</strong>
    </dt>
    <dd>
    创建对象



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/TextField.html#">TextField</a></span>
        textField
    </ol>




</dd>
    <dt>
    <a name = "TextField:setClearButtonMode"></a>
    <strong>TextField:setClearButtonMode (mode)</strong>
    </dt>
    <dd>
    设置清空按钮的模式


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">mode</span>
            <span class="types"><span class="type">ClearButtonMode</span></span>
         0 None 1 WhileEditing
        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:setDelegate"></a>
    <strong>TextField:setDelegate (table)</strong>
    </dt>
    <dd>
    设置代理


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">table</span>



        </li>
    </ul>




    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> textField=ca.TextField.new()
textField:setDelegate{
	onShouldBeginEditing=selector(self,Controller.onShouldBeginEditing),
	onShouldEndEditing=selector(self,Controller.onShouldEndEditing),
	onShouldReturn=selector(self,Controller.onShouldReturn),
	keyBoardHeight=selector(self,Controller.keyBoardHeight),
}</pre>
    </ul>

</dd>
    <dt>
    <a name = "TextField:getClearButtonMode"></a>
    <strong>TextField:getClearButtonMode ()</strong>
    </dt>
    <dd>
    获取清空按钮的模式



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">ClearButtonMode</span></span>
        mode 0 None 1 WhileEditing
    </ol>




</dd>
    <dt>
    <a name = "TextField:setMarginLeft"></a>
    <strong>TextField:setMarginLeft (margin)</strong>
    </dt>
    <dd>
    设置文本左边边距


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">margin</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getMarginLeft"></a>
    <strong>TextField:getMarginLeft ()</strong>
    </dt>
    <dd>
    文本左边边距



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">int</span></span>
        margin
    </ol>




</dd>
    <dt>
    <a name = "TextField:setMarginRight"></a>
    <strong>TextField:setMarginRight (margin)</strong>
    </dt>
    <dd>
    设置文本右边边距


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">margin</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getMarginRight"></a>
    <strong>TextField:getMarginRight ()</strong>
    </dt>
    <dd>
    文本右边边距



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">int</span></span>
        margin
    </ol>




</dd>
    <dt>
    <a name = "TextField:setMarginImageLeft"></a>
    <strong>TextField:setMarginImageLeft (size, image)</strong>
    </dt>
    <dd>
    设置文本左边图标


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">size</span>
            <span class="types"><span class="type">Size</span></span>



        </li>
        <li><span class="parameter">image</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:setMarginImageRight"></a>
    <strong>TextField:setMarginImageRight (size, image)</strong>
    </dt>
    <dd>
    设置文本右边图标


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">size</span>
            <span class="types"><span class="type">Size</span></span>



        </li>
        <li><span class="parameter">image</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:setFontSize"></a>
    <strong>TextField:setFontSize (size)</strong>
    </dt>
    <dd>
    设置文本尺寸


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">size</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getFontSize"></a>
    <strong>TextField:getFontSize ()</strong>
    </dt>
    <dd>
    获取文本尺寸



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">int</span></span>
        size
    </ol>




</dd>
    <dt>
    <a name = "TextField:setPlaceHolderText"></a>
    <strong>TextField:setPlaceHolderText (text)</strong>
    </dt>
    <dd>
    设置无内容时，占位文字


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">text</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getPlaceHolderText"></a>
    <strong>TextField:getPlaceHolderText ()</strong>
    </dt>
    <dd>
    获取无内容时，占位文字



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        text
    </ol>




</dd>
    <dt>
    <a name = "TextField:setPlaceHolderColor"></a>
    <strong>TextField:setPlaceHolderColor (color)</strong>
    </dt>
    <dd>
    设置占位文字的颜色


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">color</span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getPlaceHolderColor"></a>
    <strong>TextField:getPlaceHolderColor ()</strong>
    </dt>
    <dd>
    获取占位文字的颜色



    <h3>Returns:</h3>
    <ol>

        color
    </ol>




</dd>
    <dt>
    <a name = "TextField:setText"></a>
    <strong>TextField:setText (text)</strong>
    </dt>
    <dd>
    设置文本


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">text</span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getText"></a>
    <strong>TextField:getText ()</strong>
    </dt>
    <dd>
    获取文本



    <h3>Returns:</h3>
    <ol>

        text
    </ol>




</dd>
    <dt>
    <a name = "TextField:setTextColor"></a>
    <strong>TextField:setTextColor (color)</strong>
    </dt>
    <dd>
    设置文本颜色


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">color</span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getTextColor"></a>
    <strong>TextField:getTextColor ()</strong>
    </dt>
    <dd>
    获取文本颜色



    <h3>Returns:</h3>
    <ol>

        color
    </ol>




</dd>
    <dt>
    <a name = "TextField:setKeyboardType"></a>
    <strong>TextField:setKeyboardType (KeyboardType)</strong>
    </dt>
    <dd>
    设置键盘类型


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">KeyboardType</span>

Default = 0,
NumbersAndPunctuation = 1,
URL = 2,
NumberPad = 3,
PhonePad = 4,
NamePhonePad = 5,
EmailAddress = 6,
        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getKeyboardType"></a>
    <strong>TextField:getKeyboardType ()</strong>
    </dt>
    <dd>
    获取键盘类型



    <h3>Returns:</h3>
    <ol>

        KeyboardType
    </ol>




</dd>
    <dt>
    <a name = "TextField:setReturnType"></a>
    <strong>TextField:setReturnType (ReturnType)</strong>
    </dt>
    <dd>
    设置返回类型


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">ReturnType</span>

Done = 0,
Go = 1,
Next = 2,
Search = 3,
Send = 4
        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getReturnType"></a>
    <strong>TextField:getReturnType ()</strong>
    </dt>
    <dd>
    获取返回类型



    <h3>Returns:</h3>
    <ol>

        ReturnType
    </ol>




</dd>
    <dt>
    <a name = "TextField:setTextFieldAlign"></a>
    <strong>TextField:setTextFieldAlign (TextFieldAlign)</strong>
    </dt>
    <dd>
    设置文本对齐方式


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">TextFieldAlign</span>

Left = 0,
Center = 1,
Right = 2
        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getTextFieldAlign"></a>
    <strong>TextField:getTextFieldAlign ()</strong>
    </dt>
    <dd>
    获取文本对齐方式



    <h3>Returns:</h3>
    <ol>

        TextFieldAlign
    </ol>




</dd>
    <dt>
    <a name = "TextField:setSecureTextEntry"></a>
    <strong>TextField:setSecureTextEntry (secureMode)</strong>
    </dt>
    <dd>
    设置密码输入模式


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">secureMode</span>
            <span class="types"><span class="type">bool</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:isSecureTextEntry"></a>
    <strong>TextField:isSecureTextEntry ()</strong>
    </dt>
    <dd>
    是否是密码输入模式



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">bool</span></span>
        secureMode
    </ol>




</dd>
    <dt>
    <a name = "TextField:setAllowkeyBoardHide"></a>
    <strong>TextField:setAllowkeyBoardHide (allow)</strong>
    </dt>
    <dd>
    设置是否允许键盘隐藏


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">allow</span>
            <span class="types"><span class="type">bool</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:isAllowkeyBoardHide"></a>
    <strong>TextField:isAllowkeyBoardHide ()</strong>
    </dt>
    <dd>
    是否允许键盘隐藏



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">bool</span></span>
        allow
    </ol>




</dd>
    <dt>
    <a name = "TextField:setMaxLenght"></a>
    <strong>TextField:setMaxLenght (maxLen)</strong>
    </dt>
    <dd>
    设置文本最大长度


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">maxLen</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "TextField:getMaxLenght"></a>
    <strong>TextField:getMaxLenght ()</strong>
    </dt>
    <dd>
    获取文本最大长度



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">int</span></span>
        maxLen
    </ol>




</dd>
    <dt>
    <a name = "TextField:setBackgroundImage"></a>
    <strong>TextField:setBackgroundImage (image)</strong>
    </dt>
    <dd>
    设置背景图


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">image</span>
            <span class="types"><a class="type" href="../classes/Image.html#">Image</a></span>



        </li>
    </ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2017-04-25 21:28:27 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
